function addLine() {
    let str=null;
    let tbody = document.querySelector("#tbl").querySelector("tbody");
    let tr = document.createElement("tr")
    for (let i = 0; i <= 8; i++) {
        if (i == 0) {
            str+="<td width='100' name='id'></td>"
        }
        if (i ==1 ) {
            td.innerHTML = "<a onclick='delLine(this)'>删除</a>"
        }
        tr.appendChild(td)
    }
    tbody.appendChild(tr)
}



layui.use('table', function(){
    let uid= localStorage.getItem("uid")
    console.log(uid)

    var table = layui.table;

    if(uid!=null){

     table.render({
        elem: '#test'
        ,url: `http://localhost:8088/dev/userlove/list`
        ,where:{
            "uid":uid,
        }
        ,cols: [[
            { width:195, title: '序号', sort: true, type:'numbers'}
            ,{field:'songTitle', width:400, title: '歌曲名字'}
            ,{field:'singerName', width:300, title: '歌手名字'}
            ,{field:'singerAvatar', width:300, title: '图片',templet: "#imgtmp"}
            ,{field:'createTime', width:350, title: '加入时间'}
            ,{fixed: 'right', title:'播放', toolbar: '#barDemo', Width:250}
        ]]
        ,page: true
        ,limits: [10,20,30,40,50]
        ,limit: 10
        , parseData: function (res) {
            var result;
                str = `<a href="http://localhost:8088/dev/views/cxy/bofang.html?id={{d.sid}}" class="glyphicon glyphicon-play-circle logo" style="top: 20px" ></a><br> `
                $("#barDemo").html(str);
            if (this.page.curr) {
                result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
            } else {

                result = res.data.slice(0, this.limit);
            }

            return {"code": res.code, "msg": res.msg, "count": res.count, "data": result};

             console.log("count")
        }


    })}


});

// 	var	playlist = [
// // {title:name,artist:"gname",mp3:"/dev/views/cxy/music/"+name+".mp3",cover:"/dev/views/cxy/music/img/" + img,},
// {title:"Uptown Funk",artist:"Mark Ronson",mp3:"jq22-1.mp3",cover:"t2.png",},
// ];
var time=localStorage.getItem('time');
// if (time!=null)
// {

// }
// if (time!=0)
// {
// 	var isRotate = true;
// 	var autoplay = true;
// 	console.log("000")
// }

var timet=Math.round(time)
console.log(timet)
if (timet!=0)
{
    var isRotate = true;
    var autoplay = false;

}else {
    var isRotate = true;
    var autoplay = false;
}

function bgChange(){
    var lis= $('.lib');
    for(var i=0; i<lis.length; i+=2)
        lis[i].style.background = 'rgba(246, 246, 246, 0.7)';
}
window.onload = bgChange;



$(function(){
    $("#app").load('/dev/views/slx/nav.html');
})


$(function (){
    $(".playerxiao").load('/dev/views/cxy/views/cemian.html');
})

